package cn.tedu.api;
//测试 Integer包装类
public class T1_Integer {
    public static void main(String[] args) {
        //求byte的最大值和最小值
        int max = Byte.MAX_VALUE;//127,此处通过类名Byte调用静态常量MAX_VALUE和MIN_VALUE
        int min = Byte.MIN_VALUE;//-128
        //TODO Integer
        //1 创建对象
        Integer in = new Integer(5);
        Integer in1 = new Integer(5);
        System.out.println(in==in1);
//        Integer in1 = new Integer("s");
        //
        Integer in2 = Integer.valueOf(5);
        Integer in3 = Integer.valueOf(5);//高效
        System.out.println(in2==in3);
        //调用方法  int intValue(); static int parseInt(String s)
        int x = in2.intValue();
        System.out.println(x);

        int y = in2.parseInt("123");
        System.out.println(y+1);
        //////////测试 Double类
        Double dou = new Double(5.5);
        double a = dou.doubleValue();
        System.out.println(a);
        double b = dou.parseDouble("52.123");
        System.out.println(b+1);






    }
}
